Optimal. Leaf size=60 \[ -\frac{a^2 (A+B) \sin (c+d x)}{d}-\frac{2 a^2 (A+B) \log (1-\sin (c+d x))}{d}-\frac{B (a \sin (c+d x)+a)^2}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0962114, antiderivative size = 60, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.069, Rules used = {2836, 77} \[ -\frac{a^2 (A+B) \sin (c+d x)}{d}-\frac{2 a^2 (A+B) \log (1-\sin (c+d x))}{d}-\frac{B (a \sin (c+d x)+a)^2}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2836
Rule 77
Rubi steps
\begin{align*} \int \sec (c+d x) (a+a \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx &=\frac{a \operatorname{Subst}\left (\int \frac{(a+x) \left (A+\frac{B x}{a}\right )}{a-x} \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac{a \operatorname{Subst}\left (\int \left (-A-B+\frac{2 a (A+B)}{a-x}-\frac{B (a+x)}{a}\right ) \, dx,x,a \sin (c+d x)\right )}{d}\\ &=-\frac{2 a^2 (A+B) \log (1-\sin (c+d x))}{d}-\frac{a^2 (A+B) \sin (c+d x)}{d}-\frac{B (a+a \sin (c+d x))^2}{2 d}\\ \end{align*}
Mathematica [A] time = 0.0786707, size = 51, normalized size = 0.85 \[ \frac{a \left (-a (A+2 B) \sin (c+d x)-2 a (A+B) \log (1-\sin (c+d x))-\frac{1}{2} a B \sin ^2(c+d x)\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.075, size = 127, normalized size = 2.1 \begin{align*} -{\frac{{a}^{2}A\sin \left ( dx+c \right ) }{d}}+2\,{\frac{{a}^{2}A\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}-{\frac{B{a}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{2}}{2\,d}}-2\,{\frac{B{a}^{2}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}-2\,{\frac{{a}^{2}A\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}-2\,{\frac{B{a}^{2}\sin \left ( dx+c \right ) }{d}}+2\,{\frac{B{a}^{2}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.01459, size = 70, normalized size = 1.17 \begin{align*} -\frac{B a^{2} \sin \left (d x + c\right )^{2} + 4 \,{\left (A + B\right )} a^{2} \log \left (\sin \left (d x + c\right ) - 1\right ) + 2 \,{\left (A + 2 \, B\right )} a^{2} \sin \left (d x + c\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.84076, size = 135, normalized size = 2.25 \begin{align*} \frac{B a^{2} \cos \left (d x + c\right )^{2} - 4 \,{\left (A + B\right )} a^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \,{\left (A + 2 \, B\right )} a^{2} \sin \left (d x + c\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} a^{2} \left (\int A \sec{\left (c + d x \right )}\, dx + \int 2 A \sin{\left (c + d x \right )} \sec{\left (c + d x \right )}\, dx + \int A \sin ^{2}{\left (c + d x \right )} \sec{\left (c + d x \right )}\, dx + \int B \sin{\left (c + d x \right )} \sec{\left (c + d x \right )}\, dx + \int 2 B \sin ^{2}{\left (c + d x \right )} \sec{\left (c + d x \right )}\, dx + \int B \sin ^{3}{\left (c + d x \right )} \sec{\left (c + d x \right )}\, dx\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.34599, size = 297, normalized size = 4.95 \begin{align*} \frac{2 \,{\left (A a^{2} + B a^{2}\right )} \log \left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right ) - 4 \,{\left (A a^{2} + B a^{2}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) - \frac{3 \, A a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} + 3 \, B a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} + 2 \, A a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 4 \, B a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 6 \, A a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 8 \, B a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 2 \, A a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 4 \, B a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 3 \, A a^{2} + 3 \, B a^{2}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{2}}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]